From fd6ee4bb06ec232346892cc805730e939d710e62 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Thu, 7 Apr 2011 11:39:35 +0100 Subject: [PATCH] x86/hvm: do actually init nested HVM state for VCPUs when nested HVM is enabled after VCPus are allocated. The previous patch would fail because the call to nestedhvm_vcpu_initialise() in the HVM param set code happens before nestedhvm_enabled(v->domain) is true. Signed-off-by: Tim Deegan --- xen/arch/x86/hvm/hvm.c | 3 ++- xen/arch/x86/hvm/nestedhvm.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 669330fbda..1ae4df98f0 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -967,7 +967,8 @@ int hvm_vcpu_initialise(struct vcpu *v) if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 ) goto fail2; - if ( (rc = nestedhvm_vcpu_initialise(v)) < 0 ) + if ( nestedhvm_enabled(v->domain) + && (rc = nestedhvm_vcpu_initialise(v)) < 0 ) goto fail3; /* Create ioreq event channel. */ diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c index 298f34ae1b..ef9a867527 100644 --- a/xen/arch/x86/hvm/nestedhvm.c +++ b/xen/arch/x86/hvm/nestedhvm.c @@ -74,9 +74,6 @@ nestedhvm_vcpu_initialise(struct vcpu *v) { int rc; - if ( !nestedhvm_enabled(v->domain) ) - return 0; - if ( (rc = nhvm_vcpu_initialise(v)) ) { nhvm_vcpu_destroy(v); -- 2.30.2